from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User

@admin.register(User)
class CustomUserAdmin(UserAdmin):
    fieldsets = UserAdmin.fieldsets + (
        ('额外信息', {'fields': ('phone', 'avatar')}),
    )
    add_fieldsets = UserAdmin.add_fieldsets + (
        ('额外信息', {'fields': ('phone', 'avatar')}),
    )
    list_display = ['username', 'email', 'phone', 'is_active', 'date_joined']
    search_fields = ['username', 'email', 'phone']
    list_filter = ['is_active', 'is_staff', 'date_joined']
